package com.wg.dome.repository;


import com.wg.dome.attribute.Attribute;
import com.wg.dome.attribute.AttributeType;
import com.wg.dome.entity.config.ZhuLingShoeEntity;
import com.wg.db.cache.AbstractUniqueCacheRepository;

public class ZhuLingShoeRepository extends AbstractUniqueCacheRepository<ZhuLingShoeEntity> {
    public ZhuLingShoeRepository() {
        super(ZhuLingShoeEntity.class);
    }

    public void getAttribute(int zlLv, Attribute attribute){
        ZhuLingShoeEntity entity = get(zlLv);
        if (entity == null){
            return;
        }

        attribute.set(AttributeType.CRT, entity.getCrt());
        attribute.set(AttributeType.RGS, entity.getRgs());
    }

    public int getUseCount(int zlLv){
        ZhuLingShoeEntity zhuLingShoeEntity = get(zlLv);
        return zhuLingShoeEntity.getUseItemId();
    }
}
